<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
	<head>
		<title>
			Python Open Flash Chart (pyOFC2) &mdash;  Stepped axis 
		</title>
		<meta name="author" content="Pradeep Kishore Gowda">

		<link rel="stylesheet" href="css/reset-fonts-grids.css" type="text/css">
		<link rel="stylesheet" href="css/style.css" type="text/css"> 
		<link rel="stylesheet" href="css/pygments.css" type="text/css"> 		
				
	<script type="text/javascript" src="js/swfobject.js">
	</script>
	<script type="text/javascript">
		swfobject.embedSWF(
			"open-flash-chart.swf", "chart_radar_charts_3", "780", "300",
			"9.0.0", "expressInstall.swf",
			{"data-file":"data/radar_charts_3.json"}
		);
	</script>

	</head>
	<body>
		<div id="doc2" class="yui-t2">
			<div id="hd">
				<h1>
					<a href="index.html">pyOFC2</a> Python Open Flash Chart 2
				</h1>
			</div>
			<div id="bd">
				<div id="yui-main">
					<div class="yui-b">
						<div class="yui-g">
							
	<h2>Stepped axis</h2>
	<div id="chart_radar_charts_3"></div>
	<div id="doc"><p>Radar Chart with stepped axis and custom tooltips for individual points.</p>
</div>
	<pre><div class="syntax"><pre><span class="k">def</span> <span class="nf">test_radar_charts_3</span><span class="p">():</span>
    
    <span class="n">chart</span> <span class="o">=</span> <span class="n">open_flash_chart</span><span class="p">()</span>
    <span class="n">chart</span><span class="o">.</span><span class="n">title</span> <span class="o">=</span> <span class="n">title</span><span class="p">(</span><span class="n">text</span><span class="o">=</span><span class="s">&#39;Radar Chart&#39;</span><span class="p">)</span>
    
    <span class="n">val1</span> <span class="o">=</span> <span class="p">[</span><span class="mf">30</span><span class="p">,</span><span class="mf">50</span><span class="p">,</span><span class="mf">60</span><span class="p">,</span><span class="mf">70</span><span class="p">,</span><span class="mf">80</span><span class="p">,</span><span class="mf">90</span><span class="p">,</span><span class="mf">100</span><span class="p">,</span><span class="mf">115</span><span class="p">,</span><span class="mf">130</span><span class="p">,</span><span class="mf">115</span><span class="p">,</span><span class="mf">100</span><span class="p">,</span><span class="mf">90</span><span class="p">,</span><span class="mf">80</span><span class="p">,</span><span class="mf">70</span><span class="p">,</span><span class="mf">60</span><span class="p">,</span><span class="mf">50</span><span class="p">]</span>
    <span class="n">spokes</span> <span class="o">=</span> <span class="p">[</span><span class="s">&#39;a&#39;</span><span class="p">,</span><span class="s">&#39;b&#39;</span><span class="p">,</span><span class="s">&#39;c&#39;</span><span class="p">,</span><span class="s">&#39;d&#39;</span><span class="p">,</span><span class="s">&#39;e&#39;</span><span class="p">,</span><span class="s">&#39;f&#39;</span><span class="p">,</span><span class="s">&#39;g&#39;</span><span class="p">,</span><span class="s">&#39;h&#39;</span><span class="p">,</span><span class="s">&#39;i&#39;</span><span class="p">,</span><span class="s">&#39;j&#39;</span><span class="p">,</span><span class="s">&#39;k&#39;</span><span class="p">,</span><span class="s">&#39;l&#39;</span><span class="p">,</span><span class="s">&#39;m&#39;</span><span class="p">,</span><span class="s">&#39;n&#39;</span><span class="p">,</span><span class="s">&#39;o&#39;</span><span class="p">,</span><span class="s">&#39;p&#39;</span><span class="p">]</span>
    <span class="n">val2</span> <span class="o">=</span> <span class="p">[]</span>
    
    <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="n">val1</span><span class="p">:</span>                                   
        <span class="n">txt</span> <span class="o">=</span> <span class="s">&quot;#val#&lt;br&gt;Spoke: </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="n">i</span> 
        <span class="n">tmp</span> <span class="o">=</span> <span class="n">dot_value</span><span class="p">(</span><span class="n">value</span><span class="o">=</span><span class="n">i</span><span class="p">,</span>  <span class="n">colour</span><span class="o">=</span><span class="s">&#39;#D41E47&#39;</span><span class="p">,</span> <span class="n">tip</span><span class="o">=</span><span class="n">txt</span><span class="p">)</span>
        <span class="n">val2</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">tmp</span><span class="p">)</span>
    <span class="n">line</span> <span class="o">=</span> <span class="n">line_hollow</span><span class="p">()</span>
    <span class="n">line</span><span class="o">.</span><span class="n">values</span> <span class="o">=</span> <span class="n">val2</span>
    <span class="n">line</span><span class="o">.</span><span class="n">halo_size</span> <span class="o">=</span> <span class="mf">0</span>
    <span class="n">line</span><span class="o">.</span><span class="n">width</span> <span class="o">=</span> <span class="mf">2</span>
    <span class="n">line</span><span class="o">.</span><span class="n">dot_size</span> <span class="o">=</span> <span class="mf">6</span>
    <span class="n">line</span><span class="o">.</span><span class="n">colour</span> <span class="o">=</span> <span class="s">&#39;#FBB829&#39;</span>
    <span class="n">line</span><span class="o">.</span><span class="n">text</span> <span class="o">=</span> <span class="s">&#39;Hearts&#39;</span>
    <span class="n">line</span><span class="o">.</span><span class="n">font_size</span> <span class="o">=</span> <span class="mf">10</span>
    <span class="n">line</span><span class="o">.</span><span class="n">loop</span> <span class="o">=</span> <span class="bp">True</span>
    <span class="n">chart</span><span class="o">.</span><span class="n">add_element</span><span class="p">(</span><span class="n">line</span><span class="p">)</span>
    <span class="n">r</span> <span class="o">=</span> <span class="n">radar_axis</span><span class="p">(</span><span class="nb">max</span><span class="o">=</span><span class="mf">150</span><span class="p">)</span>
    <span class="n">r</span><span class="o">.</span><span class="n">step</span> <span class="o">=</span> <span class="mf">10</span>
    <span class="n">r</span><span class="o">.</span><span class="n">colour</span> <span class="o">=</span> <span class="s">&#39;#DAD5E0&#39;</span>
    <span class="n">r</span><span class="o">.</span><span class="n">grid_colour</span> <span class="o">=</span> <span class="s">&#39;#EFEFEF&#39;</span>
    <span class="n">chart</span><span class="o">.</span><span class="n">radar_axis</span> <span class="o">=</span> <span class="n">r</span>
    <span class="n">tip</span> <span class="o">=</span> <span class="n">tooltip</span><span class="p">(</span><span class="n">proximity</span><span class="o">=</span><span class="mf">1</span><span class="p">)</span>
    <span class="n">chart</span><span class="o">.</span><span class="n">tooltip</span> <span class="o">=</span> <span class="n">tip</span>
    <span class="n">chart</span><span class="o">.</span><span class="n">bg_colour</span> <span class="o">=</span> <span class="s">&#39;#FFFFFF&#39;</span>
    <span class="k">return</span> <span class="n">chart</span>
</pre></div>
</pre> 
	<div id="json">
		<p>Data used to generate the chart &mdash; <a href="data/radar_charts_3.json">radar_charts_3.json</a></p>
	</div>

							
						</div>
					</div>
				</div>
				<div class="yui-b" id="sidebar"> 
					<h3>
						Chart Demos
					</h3>
					    <dl><dt class="el2">Area Charts</dt><dd>
<li><a href="area_hollow.html">Area Hollow Chart</a></li>
<li><a href="area_line.html">Area Line Chart</a></li>
</dd>
<dt class="el2">Bar Charts</dt><dd>
<li><a href="bar.html">Bar Chart</a></li>
<li><a href="bar_2.html">Bar Chart 2</a></li>
</dd>
<dt class="el2">Bar Filled Charts</dt><dd>
<li><a href="bar_filled.html">Bar Filled Chart</a></li>
</dd>
<dt class="el2">Horizontal Bar Charts</dt><dd>
<li><a href="horizontal_bar.html">Horizontal Bar Chart</a></li>
</dd>
<dt class="el2">Line Charts</dt><dd>
<li><a href="line.html">Line</a></li>
<li><a href="line_dot.html">Line Dot</a></li>
<li><a href="line_hollow.html">Line Hollow</a></li>
<li><a href="manylines.html">Many Lines</a></li>
</dd>
<dt class="el2">Radar Charts</dt><dd>
<li><a href="radar_charts_1.html">Radar Chart</a></li>
<li><a href="radar_charts_2.html">Lines & Spoke labels</a></li>
<li><a href="radar_charts_3.html">Stepped axis</a></li>
</dd>
<dt class="el2">Scatter Charts</dt><dd>
<li><a href="scatter_chart.html">Scatter Chart</a></li>
<li><a href="scatter_line_chart.html">Scatter Line Chart</a></li>
</dd>
<dt class="el2">Shapes</dt><dd>
<li><a href="shape.html">Shapes</a></li>
</dd>
<dt class="el2">X Axis Labels</dt><dd>
<li><a href="x_axis_labels_1.html">X Axis Labels 1</a></li>
<li><a href="x_axis_labels_3.html">X Axis Labels 3</a></li>
</dd></dl> 
					<h3>
						Resources
					</h3>
					<ul>
						<li>
							<a href="http://teethgrinder.co.uk/open-flash-chart-2/">Open Flash Chart</a>
						</li>
						<li>
							<a href="http://github.com/btbytes/pyofc2">pyOFC2 source (github)</a>
						</li>
					</ul>
				</div>
			</div>
			<div id="ft">
			  &copy; 2009 <a href="http://pradeepgowda.com/">Pradeep Kishore Gowda</a>
			</div>
		</div>
	</body>
</html>